<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>MiniVue-Demo</title>
</head>
</html>
<body>
   <div id="app" test="1">
        <p>姓名：{{name}}</p>
        <p>年龄：{{age}}</p>
        <button @click="increase">年龄+1</button>
        <input v-model="age" :bind="name">
        <button @click="sayHi">sayHi</button>
    </div>
</body>
<script>
    const vm = new MiniVue({
        el: '#app',
        data: {
            age: 18,
            name: '小明',
            obj: {
                a:1
            }
        },
        methods: {
            increase() {
                this.age++
            },
            sayHi() {
                alert('hi')
            }
        },
        watch: {
            age() {
                console.log('年龄变成了' + this.age)
            }
        }
    })
</script>